function showexternal(){
	var lastone = 0, firstone = 7;
	var lastone2 = 0, firstone2 = 7;	
	var a = 0, a2 = 0, t = 0;	
	$(jetpack.tabs.focused.contentDocument).find("a").each(function(){
		a = jetpack.tabs.focused.url.substring(7,100).indexOf('/') + 7;
		a2 = this.href.substring(7,100).indexOf('/') + 7;
		lastone = 0; firstone = 7;lastone2 = 0;firstone2 = 7;
		if (a2 > a) t = a2; else t = a;
		for (var i = 0;i < t;i++){
			if (jetpack.tabs.focused.url.substring(i,i + 1) == '.'){ lastone = i;}
			if (this.href.substring(i,i + 1) == '.'){ lastone2 = i;}		
		}
		for (var i = 0;i < t;i++){
			if ((jetpack.tabs.focused.url.substring(i,i + 1) == '.') && (i != lastone)){firstone = i + 1;}
			if ((this.href.substring(i,i + 1) == '.') && (i != lastone2)){firstone2 = i + 1;}		
		}
		if (jetpack.tabs.focused.url.substring(firstone, a) != this.href.substring(firstone2,a2)){
			this.style.background = 'transparent url("") no-repeat scroll right center';
			this.style.padding = '0px 13px 0px 0px';
		}
	});
}
jetpack.statusBar.append({ 
	html: "<img src = 'http://en.wikipedia.org/skins-1.5/monobook/external.png'></img><input type='checkbox'>",
	width:30,
	onReady: function(widget){ 
	$("input", widget).click(function(){  
		if ( this.checked ){ 
			jetpack.tabs.onReady( showexternal ); 
			showexternal();
		}
		else jetpack.tabs.onReady.unbind( showexternal );  
	});
    } 
});
